<link rel="stylesheet" type="text/css" href="../static/Huploadify-master/Huploadify.css">
<script type="text/javascript" src="../static/Huploadify-master/jquery.Huploadify.js"></script>
<style>
    li {
        list-style-type: none;
        vertical-align: middle;
        height: 30px;
        line-height: 30px;
        margin: 10px 0;
    }
    li a{text-decoration:none;}
    li a img{
        border:1px solid #999999;
        margin-right: 20px;
        float: left
    }
    li a div{
        float: left;
        width: 50%;
        text-align: center;
        height: 30px;
        line-height: 30px;
        vertical-align: middle;
        white-space:nowrap;
        overflow:hidden;
        text-overflow:ellipsis;
    }
    li a div{
        width:50%;
        text-align: center;
    }

</style>
<script type="text/javascript">
    $(function () {
        var keyId = (getUrlParam("keyId", url));
        fy_api.load_template({

        controller: $("#saveForm").attr("templateParam", "keyId=" + keyId), loading: true, initValue: true, loaded: function(){

                if(keyId != ""){

                }else{
                    //添加
                    $("#divEdit").remove();
                    $("#saveForm").attr("action","columnExt/save.do")
                }
                loaded();
                init();
            }
        });
    });

    function init(){
        $("#btnSave").click(function () {
            if (!checkForm(document.getElementById("saveForm"))) {
                return;
            }
            $("#btnSave").blur();
            showLoading();

            fy_api.ajaxSubmit($("#saveForm"),{
                success: function (data) {
                    hideLoading();
                    if (!isSuccess(data)) {
                        $.messager.alert('系统提示', data.msg, 'error', function () {
                            self.focus();
                        });
                    } else {
                        parent.grid_get("grid").datagrid("load");
                        turnBack();
                    }
                }
            });
        });
    }

    function turnBack() {
        parent.j_closeWin();
    }

    //金融代码
    function loaded() {
        $('#company').inputgrid({
            idField: 'o.id',
            textField: 'o.name',
            searchField: ['o.code', 'o.name'],//查询字段多字段匹配
            columns: [[
                {field: 'o.id', title: 'ID'},
                {field: 'o.code', title: '金融代码'},
                {field: 'o.name', title: '名称'},
                {field: 'o.address', title: '地址'}
            ]],
            _page: parent.page_list,
            _append: [],//隐藏列
            _table: "company as o",
            _db: "slave"
        });
    }

</script>
<form action="columnExt/update.do" method="post" id="saveForm" templateUrl="columnExt/get.do">
    <div id="divEdit">
        <input type="hidden" name="id" value="${content.id}"/>
    </div>
    <table style="margin: 10px auto;border: 1px solid darkgrey;padding: 10px">
        <tr>
            <td>
                <div class="div-label"><span class="nullTip">*</span>公司名称：</div>
            </td>
            <td>
                <div class="div-item">
                    <input name="companyId" type="hidden" id="companyId"  value="${content.companyId}" clear/>
                    <input type="text" style="width: 93%" name="companyName" isNull id="company" value="${content.companyName}"/>
                </div>
            </td>
        </tr>
        <tr>
            <td>
                <div class="div-label"><span class="nullTip">*</span>字段名称：</div>
            </td>
            <td>
                <div class="div-item" style="width: 90%">
                    <input style="width: 93%" type="text" isNull name="columnKey" value="${content.columnKey}" />
                </div>
            </td>
            <td>
                <div class="div-label">字段默认值：</div>
            </td>
            <td>
                <div class="div-item">
                    <input type="text" name="defaultValue" value="${content.defaultValue}" />
                </div>
            </td>
        </tr>
        <tr>
            <td>
                <div class="div-label"><span class="nullTip">*</span>是否启用：</div>
            </td>
            <td>
                <div class="div-item">
                    <select name="useFlag" id="useFlag" style="width: 160px;" value="${content.useFlag}" >
                        <option value="0" >启用</option>
                        <option value="1" >禁用</option>
                    </select>
                </div>
            </td>
            <td>
                <div class="div-label"><span class="nullTip">*</span>显示页面：</div>
            </td>
            <td>
                <div class="div-item">
                    <select name="type" id="type" style="width: 160px;" value="${content.type}" >
                        <option value="0" >下单</option>
                        <option value="1" >取款</option>
                    </select>
                </div>
            </td>
        </tr>
        <tr>
            <td>
                <div class="div-label">备注：</div>
            </td>
            <td colspan="3">
                <div class="div-item" style="width: 90%">
                    <input type="text" name="remark" value="${content.remark}" />
                </div>
            </td>
        </tr>
    </table>
</form>
<div class="form-buttons">
    <a id="btnSave" class="easyui-linkbutton" iconCls="icon-save">保存</a>
    <a id="btnBack" class="easyui-linkbutton c2" iconCls="icon-undo" onClick="turnBack();">返回</a>
</div>